package com.shizhan.factory;

import com.shizhan.controller.IStuController;
import com.shizhan.controller.impl.StuControllerImpl;
import com.shizhan.dao.IStuDao;
import com.shizhan.dao.impl.StuDaoImpl;
import com.shizhan.service.IStuService;
import com.shizhan.service.impl.StuServiceImpl;

import java.io.IOException;
import java.util.Properties;

public class Factory {
    public static IStuDao getStuDao() throws IOException {
        Properties properties = new Properties();
        properties.load(ClassLoader.getSystemResourceAsStream("prop.properties"));
        return new StuDaoImpl();
    }

    public static IStuService getStuService(){
        return  new StuServiceImpl();
    }

    public static IStuController getStuController(){
        return new StuControllerImpl();
    }
}
